home *** CD-ROM | disk | FTP | other *** search
- <WIZSET QueryFieldList = ''>
- <WIZSET FieldCount = '0'>
- <WIZLOOP index="CurrentField" list="$${ResultFields}">
- <WIZSET FieldCount = FieldCount + 1>
- <!---- field is in format 'sTable.sField=sType;nSize;bRequired' ---->
- <WIZSET SeparatorPos = Find( CurrentField, '=' )>
- <WIZSET TableFieldName = Left( CurrentField, SeparatorPos - 1 )>
- <WIZSET QueryFieldList = QueryFieldList & TableFieldName & ' AS ResultField' & FieldCount & ', '>
- </WIZLOOP>
- <WIZSET SeparatorPos = Find( UniqueIdentifier, '=' )>
- <WIZSET TableFieldName = Left( UniqueIdentifier, SeparatorPos - 1 )>
- <WIZSET QueryFieldList = QueryFieldList & TableFieldName & ' AS ID_Field'>
-
-
- <WIZSET QueryTableList = ''>
- <WIZLOOP index="i" list="$${Tables}">
- <WIZSET QueryTableList = QueryTableList & i & ', '>
- </WIZLOOP>
- <WIZSET QueryTableList = Left( QueryTableList, Len(QueryTableList) - 2 )>
-
-
- <WIZSET QueryJoinList = ''>
- <WIZLOOP index="i" list="$${Joins}">
- <WIZSET QueryJoinList = QueryJoinList & i & ' AND '>
- </WIZLOOP>
-
- <!--- Create Criteria string for query from data entered thru search form --->
- <CFSET Criteria = ''>
- <WIZSET i = 0
- ><WIZLOOP index="CurrentField" list="$${SearchFields}"
- ><WIZSET i = i + 1><CF_$${SafeApplicationName}_AppendCriteria
- FieldName="#Form.Crit$${i}_FieldName#"
- FieldType="#Form.Crit$${i}_FieldType#"
- Operator="#Form.Crit$${i}_Operator#"
- Value="#Form.Crit$${i}_Value#">
- </WIZLOOP>
-
- <!----
- <CFSET GetOperator = "ListGetAt( ##OperatorList##, ##FormCondition## )">
- <CFSET GetOperand = "Evaluate( ListGetAt( ##OperandList##, ##FormCondition## ))">
-
- <CFSET ConditionList = "CONTAINS,EQUAL,NOT_EQUAL,BEGINS_WITH,ENDS_WITH,GREATER_THAN,SMALLER_THAN,GREATER_EQUAL,SMALLER_EQUAL">
- <CFSET OperatorList = "LIKE,=,<>,LIKE,LIKE,>,<,>=,<=">
- <CFSET OperandList = """%##FormValue##%"",""##FormValue##"",""##FormValue##"",""##FormValue##%"",""%##FormValue##"",""##FormValue##"",""##FormValue##"",""##FormValue##"",""##FormValue##""">
- ---->
-
- <!--- Query returning search results --->
- <CFQUERY name="SearchResult" dataSource="$${DataSource}">
- SELECT DISTINCT $$QueryFieldList
- FROM $$QueryTableList
- WHERE $$QueryJoinList
- #PreserveSingleQuotes(Criteria)#
- </CFQUERY>
-
-
- <HTML><HEAD>
- <TITLE>$${ApplicationName} - Search Result</TITLE>
- </HEAD><BODY bgcolor="ffffff">
-
-
- <FONT size="+1">$$ApplicationName</FONT> <BR>
- <FONT size="+2"><B>Search Result</B></FONT>
-
- <P>
-
- <TABLE border=0 cellpadding=3 cellspacing=0>
-
- <TR bgcolor="cccccc">
- <TD> </TD>
- <WIZLOOP index="i" list="$${ResultFields}"
- ><WIZSET Separator1Pos = Find( i, '.' )
- ><WIZSET Separator2Pos = Find( i, '=' )
- ><WIZSET FieldName = Mid( i, Separator1Pos + 1, Separator2Pos - Separator1Pos - 1 )
- > <TD>$${FieldName}</TD>
- </WIZLOOP>
- </TR>
-
- <CFOUTPUT query="SearchResult">
- <TR bgcolor="#IIf(CurrentRow Mod 2, DE('ffffff'), DE('ffffcf'))#">
- <TD><A href="$${SafeApplicationName}_Detail.cfm?ID=#URLEncodedFormat(ID_Field)#">[detail]</A></TD>
- <WIZLOOP index="i" from="1" to="$${FieldCount}" step="1"
- ><TD>#ResultField$${i}#</TD>
- </WIZLOOP>
- </TR>
- </CFOUTPUT>
-
- </TABLE>
-
-
- </BODY></HTML>